-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new ec2_instance_create role #123
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are here, shouldn't we also provide a playbook for this role?
tests/integration/targets/test_ec2_instance_create/tasks/test_ec2_with_igw_sg_eip.yml
Outdated
Show resolved
Hide resolved
roles/ec2_instance_create/tasks/ec2_instance_create_operations.yml
Outdated
Show resolved
Hide resolved
roles/ec2_instance_create/tasks/ec2_instance_create_operations.yml
Outdated
Show resolved
Hide resolved
roles/ec2_instance_create/tasks/ec2_instance_create_operations.yml
Outdated
Show resolved
Hide resolved
* **ec2_instance_create_ami_id**: (Required) | ||
The AMI ID for the EC2 instance. | ||
|
||
* **ec2_instance_create_key_name**: (Required) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if it is stated in the ticket that the key name should be required this should be set as optional for 2 reasons:
- sometimes user may need to create an instance without accessing it via SSH
- In the case the role creates the key name we need to save the public key somewhere in order for the user to be able to connect to the instance
The name of the key pair to use for SSH access to the EC2 instance. | ||
If the key does not exist, a key pair will be created with the name. | ||
|
||
* **ec2_instance_create_vpc_subnet_id**: (Required) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parameter can be also optional as the instance can be created in the default subnet id if it exists
|
||
#### Elastic IP | ||
|
||
* **ec2_instance_create_vpc_id**: (Optional) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parameter can be removed as the role can determine the VPC id from the ec2_instance_create_vpc_subnet_id
parameter or the default vpc id
|
||
#### External Security Group | ||
|
||
* **ec2_instance_create_external_sg_name**: (Required) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do not really need external
in the name of the security group variables
|
||
### Role Operation | ||
|
||
* **ec2_instance_create_operation**: (Optional) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be replaced by the instance state with the values: present, running...
required: false | ||
type: str | ||
default: create | ||
choices: [create, delete] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it supports value create and delete, the role must be renamed
region: "{{ ec2_instance_create_aws_region }}" | ||
filters: | ||
tag:Name: "{{ ec2_instance_create_instance_name }}" | ||
instance-state-name: ["running"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot filter on state running
because this is valid only if the user waits for the instance to boot
This adds a new role to create a ec2 instance with customizable configuration.
See: https://issues.redhat.com/browse/ACA-1959